<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>sline: C:/Users/zhu/Desktop/sline/Component/sline.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">sline<span id="projectnumber">&#160;v1.1.1</span>
   </div>
   <div id="projectbrief">This is a shell component.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_84f5943c2b4a25d8438a76cb00d93649.html">zhu</a></li><li class="navelem"><a class="el" href="dir_e8238830557e247603cce3caaa85a16c.html">Desktop</a></li><li class="navelem"><a class="el" href="dir_db193841dc67b21f7da766c1e5f29c12.html">sline</a></li><li class="navelem"><a class="el" href="dir_53f78a5796821c1c1f32bc361eada011.html">Component</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">结构体</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle"><div class="title">sline.h 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>sline命令行组件的功能实现  
<a href="#details">更多...</a></p>

<p><a href="sline_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
结构体</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsline__cmd__t.html">sline_cmd_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">命令的对象结构体  <a href="structsline__cmd__t.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsline__cmd__code__t.html">sline_cmd_code_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">代码段命令的对象结构体  <a href="structsline__cmd__code__t.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsl__register__func__t.html">sl_register_func_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">注册sline对象所需要的字符收发函数 这部分接口更为与标准C一致  <a href="structsl__register__func__t.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsl__dis__t.html">sl_dis_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">当前显示数据结构体  <a href="structsl__dis__t.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsl__env__t.html">sl_env_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">sline对象的环境结构体  <a href="structsl__env__t.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:ac30134d048f27d62b2dec7db53d0a8ea"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8h.html#ac30134d048f27d62b2dec7db53d0a8ea">SL_CMD_EXPORT</a>(func,  desc)</td></tr>
<tr class="memdesc:ac30134d048f27d62b2dec7db53d0a8ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">注册指令到代码段中  <br /></td></tr>
<tr class="separator:ac30134d048f27d62b2dec7db53d0a8ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:ae065dfbcedba61e21f9e9e304d7795a5"><td class="memItemLeft" align="right" valign="top">SL_API int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8h.html#ae065dfbcedba61e21f9e9e304d7795a5">sl_create</a> (<a class="el" href="structsl__register__func__t.html">sl_register_func_t</a> *sl_rfunc)</td></tr>
<tr class="memdesc:ae065dfbcedba61e21f9e9e304d7795a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建sline对象  <br /></td></tr>
<tr class="separator:ae065dfbcedba61e21f9e9e304d7795a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05b3ad1d3093030ebdd5bf0cc987e63d"><td class="memItemLeft" align="right" valign="top">SL_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8h.html#a05b3ad1d3093030ebdd5bf0cc987e63d">sl_delete</a> (void)</td></tr>
<tr class="memdesc:a05b3ad1d3093030ebdd5bf0cc987e63d"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭sline对象  <br /></td></tr>
<tr class="separator:a05b3ad1d3093030ebdd5bf0cc987e63d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ead531b150a3e68774f187692062f7d"><td class="memItemLeft" align="right" valign="top">SL_API int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8h.html#a5ead531b150a3e68774f187692062f7d">sl_waitcmd</a> (void)</td></tr>
<tr class="memdesc:a5ead531b150a3e68774f187692062f7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">等待处理命令输入  <br /></td></tr>
<tr class="separator:a5ead531b150a3e68774f187692062f7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a138f18399b17ee2ad2280ee3a1b2b2b1"><td class="memItemLeft" align="right" valign="top">SL_API int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8h.html#a138f18399b17ee2ad2280ee3a1b2b2b1">sl_printf</a> (const char *format,...)</td></tr>
<tr class="memdesc:a138f18399b17ee2ad2280ee3a1b2b2b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">组件打印函数  <br /></td></tr>
<tr class="separator:a138f18399b17ee2ad2280ee3a1b2b2b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12763c56194a8fcadefe9bef7822f9ab"><td class="memItemLeft" align="right" valign="top">SL_API int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sline_8h.html#a12763c56194a8fcadefe9bef7822f9ab">sl_cmd_export_pre</a> (char *name, void *func, char *desc)</td></tr>
<tr class="memdesc:a12763c56194a8fcadefe9bef7822f9ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">在环境中注册指令 注意调用在sl_create之前，否则不会被注册  <br /></td></tr>
<tr class="separator:a12763c56194a8fcadefe9bef7822f9ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>sline命令行组件的功能实现 </p>
<dl class="section author"><dt>作者</dt><dd>zhuxuanlin (<a href="#" onclick="location.href='mai'+'lto:'+'xua'+'nl'+'inz'+'hu'+'@qq'+'.c'+'om'; return false;">xuanl<span class="obfuscator">.nosp@m.</span>inzh<span class="obfuscator">.nosp@m.</span>u@qq.<span class="obfuscator">.nosp@m.</span>com</a>) </dd></dl>
<dl class="section version"><dt>版本</dt><dd>1.1.1 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2023-05-18</dd></dl>
<dl class="section copyright"><dt>版权所有</dt><dd>Copyright (c) 2023 </dd></dl>
</div><h2 class="groupheader">宏定义说明</h2>
<a id="ac30134d048f27d62b2dec7db53d0a8ea" name="ac30134d048f27d62b2dec7db53d0a8ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac30134d048f27d62b2dec7db53d0a8ea">&#9670;&#160;</a></span>SL_CMD_EXPORT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SL_CMD_EXPORT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">func, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">desc&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>值:</b><div class="fragment"><div class="line">        <span class="keyword">const</span> <span class="keywordtype">char</span> sline_cmd_name##func[] = #func;                      \</div>
<div class="line">        <span class="keyword">const</span> <span class="keywordtype">char</span> sline_cmd_desc##func[] = #desc;                      \</div>
<div class="line">        __attribute__((used)) <span class="keyword">const</span> <a class="code hl_struct" href="structsline__cmd__code__t.html">sline_cmd_code_t</a> sline_cmd_t_##func \</div>
<div class="line">        __attribute__((section(<span class="stringliteral">&quot;cmd_list&quot;</span>)))= {                         \</div>
<div class="line">        sline_cmd_name##func,                                           \</div>
<div class="line">        (func),                                                         \</div>
<div class="line">        sline_cmd_desc##func                                            \</div>
<div class="line">        };</div>
<div class="ttc" id="astructsline__cmd__code__t_html"><div class="ttname"><a href="structsline__cmd__code__t.html">sline_cmd_code_t</a></div><div class="ttdoc">代码段命令的对象结构体</div><div class="ttdef"><b>Definition:</b> sline.h:65</div></div>
</div><!-- fragment -->
<p>注册指令到代码段中 </p>

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a id="a12763c56194a8fcadefe9bef7822f9ab" name="a12763c56194a8fcadefe9bef7822f9ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a12763c56194a8fcadefe9bef7822f9ab">&#9670;&#160;</a></span>sl_cmd_export_pre()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SL_API int sl_cmd_export_pre </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>desc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在环境中注册指令 注意调用在sl_create之前，否则不会被注册 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>指令名字 </td></tr>
    <tr><td class="paramname">func</td><td>指令函数指针 </td></tr>
    <tr><td class="paramname">desc</td><td>指令目的 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int 0：正常 -1:失败 </dd></dl>

</div>
</div>
<a id="ae065dfbcedba61e21f9e9e304d7795a5" name="ae065dfbcedba61e21f9e9e304d7795a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae065dfbcedba61e21f9e9e304d7795a5">&#9670;&#160;</a></span>sl_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SL_API int sl_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structsl__register__func__t.html">sl_register_func_t</a> *&#160;</td>
          <td class="paramname"><em>sl_func</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建sline对象 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">sl_func</td><td>注册的基本函数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int 0：正常 -1:失败 </dd></dl>

</div>
</div>
<a id="a05b3ad1d3093030ebdd5bf0cc987e63d" name="a05b3ad1d3093030ebdd5bf0cc987e63d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05b3ad1d3093030ebdd5bf0cc987e63d">&#9670;&#160;</a></span>sl_delete()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SL_API void sl_delete </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>关闭sline对象 </p>

</div>
</div>
<a id="a138f18399b17ee2ad2280ee3a1b2b2b1" name="a138f18399b17ee2ad2280ee3a1b2b2b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a138f18399b17ee2ad2280ee3a1b2b2b1">&#9670;&#160;</a></span>sl_printf()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SL_API int sl_printf </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>组件打印函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td></td></tr>
    <tr><td class="paramname">...</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>int </dd></dl>

</div>
</div>
<a id="a5ead531b150a3e68774f187692062f7d" name="a5ead531b150a3e68774f187692062f7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ead531b150a3e68774f187692062f7d">&#9670;&#160;</a></span>sl_waitcmd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SL_API int sl_waitcmd </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>等待处理命令输入 </p>
<dl class="section return"><dt>返回</dt><dd>int 0：正常 -1:失败 </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
</small></address>
</body>
</html>
